class Entity < ActiveRecord::Base

#  validates_numericality_of :acquired_year, {:allow_nil => true, :only_integer => true}

  validates_presence_of :museum_identifier
  validates_presence_of :museum_id
  
  validates_uniqueness_of :museum_identifier, :scope => "museum_id"
  
  belongs_to :country
  belongs_to :museum
  belongs_to :acquisition_method
  belongs_to :collection
  
  has_many :categorisations
  has_many :object_types, :through => :categorisations

  def full_name
    if self.name.blank?
      return "(unnamed)"
    else 
      return self.name
    end
  end

end
